<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>HTML Barcode SDK</title>
</head>
<body>

															<h2>How to use the Javascript provided by the SDK for creating barcodes in HTML?</h2>

The HTML Barcode SDK trial package includes the scripts and HTML source code for the Code 39 barcode. The HTML and scripts help to illustrate how to create professional quality barcodes on a web page. The registered package includes the scripts for all the supported barcodes mentioned above. 
Files included
<br /><br />
The SDK contains different subdirectories with examples and scripts for creating different types of barcodes. In each of the subdirectory, the HTML and Javascript files are provided. For example, in the "code39" subdirectory, the "csshtmlCode39Barcode.html" illustrates how to use the Javascript function provided by the HTML Barcode SDK for creating a Code 39 barcode. 

<h3>Tutorial on creating a Code 39 barcode using the HTML Barcode SDK</h3>

1.	First create a HTML file. In the file, include the appropriate barcode script. For the Code 39 barcode, this script is located in the "code39/js" subdirectory. The HTML code below assumes the Code 39 Javascript is copied to a subdirectory named "js" of the HTML file.
<br /><br />
<hr>
<pre>
&lt;script type="text/javascript" 
src="js/connectcode-javascript-code39.js"&gt;
&lt;/script&gt;
</pre>
<hr>
<br />
2.	After including the script, the following Javascript function can be called to generate the barcode. In the function below, we are creating a Code 39 barcode and the data to be used is specified in the first parameter. We will not go into the details of the rest of the parameters. For details on the parameters, refer to the HTML Barcode SDK Properties section.
<br /><br />
<hr>
<br />
DrawHTMLBarcode_Code39("12345678",1,"yes","in",
                        0,3,1,3,"bottom","center",
                        "","black","white");
<br /><br /><hr>
<br />
The Javascript function automatically generates and returns HTML tags and code to be included into the HTML source file. 
For example, if the HTML file includes the following <div> tags.
<br /><br /><hr>
<pre>
&lt;div id="barcodecontainer" style="width:5in"&gt;
&lt;div id="barcode" &gt;12345678&lt;/div&gt;
&lt;/div&gt;
</pre>
<hr>
<br />
The following Javascript function call will replace the data with the generated barcode. 
document.getElementById("barcode").innerHTML
<br /><br />
<hr>
<br />
 =DrawHTMLBarcode_Code39("12345678",1,"yes","in",
                         0,3,1,3,"bottom","center",
                         "","black","white");
<br /><br /><hr>
<br />
We suggest using a &lt;div&gt; container as in the case of "barcodecontainer" as shown above. Simply allocate enough space in the container for including the actual barcode. The container is useful as it will be used by the SDK to determine the alignment of the barcode and the human readable text. In our case above, five inches of space is allocated for the barcode container.  
<br /><br />
3.	We have included the full contents of the HTML file for creating the Code39 barcode below. The get_object Javascript function is simply a wrapper to ensure cross browser compatibility. 
<center>
<br /><br />
<a href=code39html.txt>HTML Code 39 Source File</a>
<br /><br />
</center>
</body>
</html>
</pre>


</body>
</html>
